#include <cstdio>
#include <cstring>
#include <algorithm>
#define N (1<<20)+10
using namespace std;
int MOD = 1000000007;
long long a[N], tmp[N];
int n, m;
int main(){
	while(scanf("%d%d", &n, &m)!=EOF){
		memset(a, 0, sizeof(a));
		a[0]=1;
		for (int i=0;i<n;i++)
			for (int j=0;j<m;j++){
				memcpy(tmp, a, sizeof(a));
				//memset(tmp, 0, sizeof(tmp));
				for (int st=0;st<(1<<(n+m));st++)
					if (a[st])
					tmp[st|(1<<i)|(1<<(n+j))]+=(a[st]*2);
				for (int st=0;st<(1<<(n+m));st++)
					a[st]=tmp[st]%MOD;
			}
		printf("%lld\n", a[(1<<(n+m))-1]);
	}

	return 0;
}
